<?php
/**
 * Tollpost Stykkgods
 *
 * @copyright Copyright 2003-2009 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tollpost_common.php 40 2010-08-15 22:38:48Z syntaxerror.no $
*/

function buildXmlArray($_xmldata) {
		$result = true;
		$arr_xml = array();

		$xml_parser = xml_parser_create();
		xml_parse_into_struct($xml_parser, $_xmldata, $vals, $index);
		xml_parser_free($xml_parser);	

		foreach($vals as $arr) {
			// dont include the root node
			if($arr['level']>1) $arr_xml[$arr['tag']] += trim($arr['value']); //+= alle priser legges sammen (oppkrav, energitillegg, fraktpris)
		}

		if(is_array($arr_xml))
			if(sizeof($arr_xml) > 0)
				$result = $arr_xml;

		return $result;
}
?>
